/**
 * 
 */
package com.leyu.mall.site.utils;

import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

import com.leyu.mall.site.shiro.ext.SiteAuthorizingRealm.UerModel;

;

/**
 * @author change
 * 
 */
public abstract class UserUtils {

	public static UerModel getUserModel() {
		Subject subject = SecurityUtils.getSubject();
		if (subject == null) {
			return null;
		}
		UerModel member = (UerModel) subject.getPrincipal();
		return member;
	}

	public static String getUsername() {

		return "test";
	}

	public static boolean isLogined() {
		Subject subject = SecurityUtils.getSubject();
		if (subject != null) {
			return subject.isAuthenticated();
		}
		return false;
	}

	public String[] getPermisions() {
		return null;
	}

	public boolean hasPermision(String per) {
		return false;
	}

	public String[] getRoles() {
		return null;
	}

	public boolean hasRole(String role) {
		return false;
	}

}
